/*
 * @copyright fxsen <br/>
 * @date 2022/4/24 19:13 <br/>
 * @email <a href="mailto:fxsen@foxmail.com">
 * @author fxsen
 */
package com.fxsen.commons.sysmanager.core.service;

import com.fxsen.commons.core.base.common.service.ICommonService;
import com.fxsen.commons.sysmanager.core.entity.LocalStorage;
import org.springframework.web.multipart.MultipartFile;

import java.util.Collection;
import java.util.List;

/**
 * 本地存储管理
 * @author fxsen
 * @date 2022/4/24 19:13
 * @email <a href="mailto:fxsen@foxmail.com">
 */
public interface ILocalStorageService extends ICommonService<LocalStorage> {
    /**
     * 上传
     * @param name 文件名称
     * @param file 文件
     * @return
     */
    LocalStorage create(String name, MultipartFile file);
    /***
    *  通过所有者id和所有者类别查询附件
    * @param ownerId
    * @param ownerCategory
    * @return {@link List}
    * @date 2022/4/28 14:53
    * @author fxsen <br/>
    * @email <a href="mailto:fxsen@foxmail.com">
    **/
    List<LocalStorage> getByOwnerIdAndOwnerCategory(String ownerId,String ownerCategory);
    /**
    * 删除附件
    * @param id 主键ID
    * @date 2022/4/28 15:05
    * @author fxsen <br/>
    * @email <a href="mailto:fxsen@foxmail.com">
    **/
    void delete(String id);
    /**
    * 批量删除附件
    * @param idList id集合
    * @date 2022/4/28 15:05
    * @author fxsen <br/>
    * @email <a href="mailto:fxsen@foxmail.com">
    **/
    void delete(Collection<LocalStorage> idList);
    /**
    * 通过所有者ID和所有者类别删除附件
    * @param ownerId
    * @param ownerCategory
    * @date 2022/4/29 15:26
    * @author fxsen <br/>
    * @email <a href="mailto:fxsen@foxmail.com">
    **/
    void deleteByOwnerIdAndOwnerCategory(String ownerId,String ownerCategory);
}
